home *** CD-ROM | disk | FTP | other *** search
- head 5.11;
- branch 5.11.0;
- access;
- symbols
- RELEASE:5.11.0.5
- BETA:5.11.0.4
- UICSO:5.11.0
- VANILLA:5.11;
- locks; strict;
- comment @ * @;
-
-
- 5.11
- date 90.06.20.08.37.07; author paul; state Exp;
- branches
- 5.11.0.1;
- next ;
-
- 5.11.0.1
- date 91.02.17.22.58.53; author paul; state Exp;
- branches;
- next 5.11.0.2;
-
- 5.11.0.2
- date 91.03.04.21.48.23; author paul; state Exp;
- branches;
- next 5.11.0.3;
-
- 5.11.0.3
- date 91.04.05.14.55.15; author paul; state Exp;
- branches;
- next 5.11.0.4;
-
- 5.11.0.4
- date 91.05.18.18.25.39; author paul; state Exp;
- branches;
- next 5.11.0.5;
-
- 5.11.0.5
- date 91.06.24.20.27.43; author paul; state Exp;
- branches;
- next ;
-
-
- desc
- @@
-
-
-
- 5.11
- log
- @5.64 Berkeley release
- @
- text
- @/*
- * Copyright (c) 1983 Eric P. Allman
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted provided
- * that: (1) source distributions retain this entire copyright notice and
- * comment, and (2) distributions including binaries display the following
- * acknowledgement: ``This product includes software developed by the
- * University of California, Berkeley and its contributors'' in the
- * documentation or other materials provided with the distribution and in
- * all advertising materials mentioning features or use of this software.
- * Neither the name of the University nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
- #ifndef lint
- static char sccsid[] = "@@(#)stats.c 5.11 (Berkeley) 6/1/90";
- #endif /* not lint */
-
- # include "sendmail.h"
- # include "mailstats.h"
-
- struct statistics Stat;
-
- #define ONE_K 1000 /* one thousand (twenty-four?) */
- #define KBYTES(x) (((x) + (ONE_K - 1)) / ONE_K)
- /*
- ** MARKSTATS -- mark statistics
- */
-
- markstats(e, to)
- register ENVELOPE *e;
- register ADDRESS *to;
- {
- if (to == NULL)
- {
- if (e->e_from.q_mailer != NULL)
- {
- Stat.stat_nf[e->e_from.q_mailer->m_mno]++;
- Stat.stat_bf[e->e_from.q_mailer->m_mno] +=
- KBYTES(CurEnv->e_msgsize);
- }
- }
- else
- {
- Stat.stat_nt[to->q_mailer->m_mno]++;
- Stat.stat_bt[to->q_mailer->m_mno] += KBYTES(CurEnv->e_msgsize);
- }
- }
- /*
- ** POSTSTATS -- post statistics in the statistics file
- **
- ** Parameters:
- ** sfile -- the name of the statistics file.
- **
- ** Returns:
- ** none.
- **
- ** Side Effects:
- ** merges the Stat structure with the sfile file.
- */
-
- poststats(sfile)
- char *sfile;
- {
- register int fd;
- struct statistics stat;
- extern off_t lseek();
-
- if (sfile == NULL)
- return;
-
- (void) time(&Stat.stat_itime);
- Stat.stat_size = sizeof Stat;
-
- fd = open(sfile, 2);
- if (fd < 0)
- {
- errno = 0;
- return;
- }
- if (read(fd, (char *) &stat, sizeof stat) == sizeof stat &&
- stat.stat_size == sizeof stat)
- {
- /* merge current statistics into statfile */
- register int i;
-
- for (i = 0; i < MAXMAILERS; i++)
- {
- stat.stat_nf[i] += Stat.stat_nf[i];
- stat.stat_bf[i] += Stat.stat_bf[i];
- stat.stat_nt[i] += Stat.stat_nt[i];
- stat.stat_bt[i] += Stat.stat_bt[i];
- }
- }
- else
- bcopy((char *) &Stat, (char *) &stat, sizeof stat);
-
- /* write out results */
- (void) lseek(fd, (off_t) 0, 0);
- (void) write(fd, (char *) &stat, sizeof stat);
- (void) close(fd);
- }
- @
-
-
- 5.11.0.1
- log
- @ANSIfied.
- @
- text
- @a35 1
- void
- a67 1
- void
- d69 1
- a69 1
- const char *sfile;
- d73 1
- @
-
-
- 5.11.0.2
- log
- @ANSIfied.
- @
- text
- @d71 1
- a71 1
- char *sfile;
- @
-
-
- 5.11.0.3
- log
- @Added RCS ID string
- @
- text
- @a22 1
- static char rcsid[] = "@@(#)$Id$";
- @
-
-
- 5.11.0.4
- log
- @Now stores message lengths in unsigned number of bytes. Part of the
- System 5 and general improvement patches contributed by Bruce Lilly
- (bruce%balilly@@broadcast.sony.com).
- @
- text
- @d22 2
- a23 2
- static char sccsid[] = "@@(#)stats.c 5.11 (Berkeley) 6/1/90 %I% local";
- static char rcsid[] = "@@(#)$Id: stats.c,v 5.11.0.3 1991/04/05 14:55:15 paul Exp paul $";
- d31 2
- d47 2
- a48 1
- Stat.stat_bf[e->e_from.q_mailer->m_mno] += CurEnv->e_msgsize;
- d54 1
- a54 1
- Stat.stat_bt[to->q_mailer->m_mno] += CurEnv->e_msgsize;
- d80 1
- a80 1
- (void) time((TIME_TYPE *) &Stat.stat_itime);
- @
-
-
- 5.11.0.5
- log
- @editted sccsid.
- @
- text
- @d22 2
- a23 2
- static char sccsid[] = "@@(#)stats.c 5.11 (Berkeley) 6/1/90";
- static char rcsid[] = "@@(#)$Id: stats.c,v 5.11.0.4 1991/05/18 18:25:39 paul Exp paul $";
- @
-